﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MaestraVotante.Master" AutoEventWireup="true"
    CodeBehind="Pagina_Inicio.aspx.cs" Inherits="VotanetWebSite.Home.Pagina_Inicio" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="head" ContentPlaceHolderID="headMaestro" runat="server">
    <script src="../JavaScript/adminFunction.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="ContentPlaceHolderMaestro" runat="server">
       
    <style type="text/css">
        .TextIndicator_txtnewPass_Strength1
        {
            background-color: Gray;
            color: #FF9900;
            padding: 3px 4px 3px 4px;
            font-size: small;
            font-weight: bold;
        }
        .TextIndicator_txtnewPass_Strength2
        {
            background-color: Gray;
            color: #FFCC33;
            font-size: small;
            padding: 3px 4px 3px 4px;
            font-weight: bold;
        }
        .TextIndicator_txtnewPass_Strength3
        {
            background-color: Gray;
            color: #CCCC33;
            font-size: small;
            padding: 3px 4px 3px 4px;
            font-weight: bold;
        }
    </style>
    <div class="bordeRedondo">
        <div class="encabezado">
            <asp:Label ID="lblMenu" runat="server" Text="Mis Datos" CssClass="label12"></asp:Label>
            <div style="text-align: right;">
                <asp:Label ID="lblNombreVotanteLogin" runat="server" Text="" CssClass="label12"></asp:Label>
                &nbsp;&nbsp;
                <br />
                <asp:ImageButton ID="BtnLogout" runat="server" ImageUrl="~/Images/logout.png" Style="margin-right: 30px;
                    margin-top: 5px;" OnClick="BtnLogout_Click" />
            </div>
        </div>
        <br />
        <table>
            <tr>
                <td rowspan="6">
                    <asp:Image ID="VoterPicture" runat="server" />
                </td>
                <td colspan="5">
                    <asp:Label ID="lblNomreVotante" runat="server" CssClass="label14"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                </td>
            </tr>
            <tr>
                <td>
                    <span class="label12">Rut :</span>
                </td>
                <td>
                    <asp:Label ID="lblRut" runat="server" CssClass="labelBold"></asp:Label>
                </td>
                <td>
                </td>
                <td>
                    <span class="label12">Fecha Nacimiento :</span>
                </td>
                <td>
                    <asp:Label ID="lblFechaNacimiento" runat="server" CssClass="labelBold"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <span class="label12">Email :</span>
                </td>
                <td>
                    <asp:Label ID="lblEmail" runat="server" CssClass="labelBold"></asp:Label>
                </td>
                <td>
                </td>
                <td>
                    <span class="label12">Direccion :</span>
                </td>
                <td>
                    <asp:Label ID="lblDireccion" runat="server" CssClass="labelBold"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <span class="label12">Telefono :</span>
                </td>
                <td>
                    <asp:Label ID="lbltelefono" runat="server" CssClass="labelBold"></asp:Label>
                </td>
                <td>
                </td>
                <td>
                    <span class="label12">Celular :</span>
                </td>
                <td>
                    <asp:Label ID="lblcelular" runat="server" CssClass="labelBold"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <div class="bordeRedondo">
        <div class="encabezado">
            <span class="label12">Mis Votaciones</span>
        </div>
        <br />
        <div style="max-width: 50%">
            <div class="grid" style="max-width: 100%">
                <div class="rounded">
                    <div class="mid-outer">
                        <div class="mid-inner">
                            <div class="mid">
                                <asp:Label ID="lblmensaje" runat="server" Text="No exiten votaciones activas" CssClass="label14"
                                    Visible="false" Enabled="false"></asp:Label>
                                <asp:GridView ID="GrillaVotaciones" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                    CellPadding="0" CssClass="datatable" CellSpacing="0" BorderWidth="0" GridLines="None"
                                    PageSize="10" ShowFooter="true" OnRowCommand="GrillaVotaciones_RowCommand">
                                    <PagerStyle CssClass="pager-row" />
                                    <RowStyle CssClass="row" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Nombre Votacion">
                                            <ItemTemplate>
                                                <asp:Label ID="lblnombreVotacion" runat="server" Text='<%# Eval("name") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Fecha Inicio">
                                            <ItemTemplate>
                                                <asp:Label ID="lblfechaInicio" runat="server" Text='<%# Eval("votingDateStart","{0:d MMMM, yyyy}") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Fecha Termino">
                                            <ItemTemplate>
                                                <asp:Label ID="lblfechaTermino" runat="server" Text='<%# Eval("votingDateEnd","{0:d MMMM, yyyy}") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Hora Inico">
                                            <ItemTemplate>
                                                <asp:Label ID="lblHoraInicio" runat="server" Text='<%# Eval("votingStartTime") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Hora Termino">
                                            <ItemTemplate>
                                                <asp:Label ID="lblHoraTermino" runat="server" Text='<%# Eval("votingEndTime") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Estado">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="ImageButtonVotar" runat="server" ImageUrl="~/Images/vota.jpg"
                                                    ToolTip="Vota ya!!" ValidationGroup="VotoVotante" CommandName="votoVotante" CommandArgument='<%# Eval("id") %> ' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <asp:GridView ID="GrillaComprobante" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                    CellPadding="0" CssClass="datatable" CellSpacing="0" BorderWidth="0" GridLines="None"
                                    PageSize="10" ShowFooter="true" OnRowCommand="GrillaComprobante_RowCommand" Visible="false"
                                    Enabled="false">
                                    <PagerStyle CssClass="pager-row" />
                                    <RowStyle CssClass="row" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Nombre Votacion">
                                            <ItemTemplate>
                                                <asp:Label ID="lblnombreVotacion" runat="server" Text='<%# Eval("votingName") %> '></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Tu Comprobante">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="ImageButtonComprobante" runat="server" ImageUrl="~/Images/pdf.jpg"
                                                    ToolTip="Descarga ya" ValidationGroup="ComprobanteVotoVotante" CommandName="votoVotante"
                                                    CommandArgument='<%# Eval("voucherPath") %> ' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="bordeRedondo">
        <div class="encabezado">
            <span class="label12">Ultimos ingresos</span>
        </div>
        <br />
        <div style="max-width: 50%;">
            <div class="grid" style="max-width: 100%">
                <div class="rounded">
                    <div class="mid-outer">
                        <div class="mid-inner">
                            <div class="mid">
                                <asp:GridView ID="GrillaLogin" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                    CellPadding="0" CssClass="datatable" CellSpacing="0" BorderWidth="0" GridLines="None"
                                    PageSize="10" ShowFooter="true">
                                    <PagerStyle CssClass="pager-row" />
                                    <RowStyle CssClass="row" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Ultimo Ingreso">
                                            <ItemTemplate>
                                                <asp:Label ID="lblUltimoIngreso" runat="server" Text='<%# Container.DataItem %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="ColumnaIzquierda">
        <asp:UpdatePanel ID="UpdatePanelIngreso" runat="server">
            <ContentTemplate>
                <div class="bordeRedondo">
                    <div class="encabezado" onclick="MostarPanel('#PanelPassword')">
                        <span class="label12">Cambiar Contraseña</span>
                    </div>
                    <br />
                    <div id="PanelPassword" style="display: none">
                        <table>
                            <tr>
                                <td>
                                    <span class="label12">Contraseña antigua :</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOldPass" runat="server" MaxLength="15" TextMode="Password"></asp:TextBox>
                                    <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtOldPass" runat="server" TargetControlID="txtOldPass"
                                        FilterType="Custom" ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890" />
                                    <asp:RequiredFieldValidator ID="RFVtxtOldPass" runat="server" ControlToValidate="txtOldPass"
                                        ValidationGroup="savePass" Display="None" ErrorMessage="Ingrese contraseña antigua"></asp:RequiredFieldValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="VCEtxtOldPass" runat="server" TargetControlID="RFVtxtOldPass">
                                    </ajaxToolkit:ValidatorCalloutExtender>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="label12">Contraseña nueva :</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtnewPass" runat="server" MaxLength="15" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredtxtnewPass" runat="server" ControlToValidate="txtnewPass"
                                        ValidationGroup="savePass" Display="None" ErrorMessage="Ingrese contraseña nueva"></asp:RequiredFieldValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorRFVtxtOldPass" runat="server"
                                        TargetControlID="RFVtxtOldPass">
                                    </ajaxToolkit:ValidatorCalloutExtender>
                                    <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtnewPass" runat="server" TargetControlID="txtnewPass"
                                        FilterType="Custom" ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890" />
                                    <ajaxToolkit:PasswordStrength ID="PasswordStrength" runat="server" TargetControlID="txtnewPass"
                                        DisplayPosition="RightSide" StrengthIndicatorType="Text" PreferredPasswordLength="15"
                                        MinimumLowerCaseCharacters="5" PrefixText="Nivel seguridad:" TextStrengthDescriptions="Baja;media;alta"
                                        StrengthStyles="TextIndicator_txtnewPass_Strength1;TextIndicator_txtnewPass_Strength2;TextIndicator_txtnewPass_Strength3"
                                        MinimumUpperCaseCharacters="5" MinimumNumericCharacters="5" RequiresUpperAndLowerCaseCharacters="true" />
                                    <asp:RegularExpressionValidator ID="REVtxtnewPass" runat="server" ControlToValidate="txtnewPass"
                                        Display="None" ValidationGroup="savePass" ErrorMessage="Contraseña invalida"
                                        ValidationExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$"></asp:RegularExpressionValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="VCEREVtxtnewPass" runat="server" TargetControlID="REVtxtnewPass">
                                    </ajaxToolkit:ValidatorCalloutExtender>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="label12">Vuelva a escribir la
                                        <br />
                                        contraseña nueva :</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtnewPassRepet" runat="server" MaxLength="15" TextMode="Password"></asp:TextBox>
                                    <ajaxToolkit:FilteredTextBoxExtender ID="filtroContrasena2" runat="server" TargetControlID="txtnewPassRepet"
                                        FilterType="Custom" ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890" />
                                    <asp:CompareValidator ID="CVContrasenas" runat="server" ErrorMessage="Contraseñas Distintas"
                                        ValidationGroup="savePass" Display="None" ControlToValidate="txtnewPassRepet"
                                        ControlToCompare="txtnewPass"></asp:CompareValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="VCEComparar" runat="server" TargetControlID="CVContrasenas">
                                    </ajaxToolkit:ValidatorCalloutExtender>
                                    <asp:RegularExpressionValidator ID="RegulartxtnewPassRepet" runat="server" ControlToValidate="txtnewPassRepet"
                                        Display="None" ValidationGroup="savePass" ErrorMessage="Contraseña invalida"
                                        ValidationExpression="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$"></asp:RegularExpressionValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorRegulartxtnewPassRepet" runat="server"
                                        TargetControlID="RegulartxtnewPassRepet">
                                    </ajaxToolkit:ValidatorCalloutExtender>
                                    <asp:RequiredFieldValidator ID="RequiredtxtnewPassRepet" runat="server" ControlToValidate="txtnewPassRepet"
                                        ValidationGroup="savePass" Display="None" ErrorMessage="Ingrese contraseña nueva"></asp:RequiredFieldValidator>
                                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatortxtnewPassRepet" runat="server"
                                        TargetControlID="RequiredtxtnewPassRepet" />
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:Button ID="btnSavePass" runat="server" Text="Guardar" ValidationGroup="savePass"
                                        CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                        OnClick="btnSavePass_Click" />
                                    &nbsp;
                                    <asp:Button ID="btnCancelPass" runat="server" Text="Cancelar" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                        OnClick="btnCancelPass_Click" />
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div class="ColumnaDerecha">
        <div class="bordeRedondo">
            <div class="encabezado" onclick="MostarPanel('#PanelImagen')">
                <span class="label12">Cambiar Imagen</span>
            </div>
            <br />
            <div id="PanelImagen" style="display: none">
                <table>
                    <tr>
                        <td colspan="6">
                            <asp:FileUpload ID="FUVoterPicture" runat="server" />
                            <asp:RequiredFieldValidator ID="RFVFUVoterPicture" runat="server" ErrorMessage="Ingrese fotografia"
                                ControlToValidate="FUVoterPicture" Display="None" ValidationGroup="GuardarVoterPicture"></asp:RequiredFieldValidator>
                            <asp:ValidatorCalloutExtender ID="vceRFVFUVoterPicture" runat="server" TargetControlID="RFVFUVoterPicture">
                            </asp:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="REFUVoterPicture" runat="server" ValidationExpression="(.*).(.jpg|.JPG|.jpeg|.JPEG)$"
                                ErrorMessage="Seleccione solo fotografias con extension jpeg,jpg o jpeg." Display="None"
                                ControlToValidate="FUVoterPicture" ValidationGroup="GuardarVoterPicture"></asp:RegularExpressionValidator>
                            <asp:ValidatorCalloutExtender ID="vceREFUVoterPicture" TargetControlID="REFUVoterPicture"
                                runat="server">
                            </asp:ValidatorCalloutExtender>
                            <br />
                            <br />
                            <asp:Button ID="btnGuardarFoto" runat="server" Text="Guardar" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                OnClick="btnGuardarFoto_Click" ValidationGroup="GuardarVoterPicture" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</asp:Content>
